package com.auto.autoapp.data.model

import com.google.gson.annotations.SerializedName


data class UserInfo(
    @SerializedName("RealName")
    val realName: String?,
    @SerializedName("ApiToken")
    val token: String?,
    @SerializedName("UserName")
    val userName: String?,
    @SerializedName("shopno")
    val shopNo: String?
)

/**
 * 用户数据模型
 */
data class User(
    @SerializedName("id")
    val id: Int,

    @SerializedName("name")
    val name: String,

    @SerializedName("email")
    val email: String,

    @SerializedName("avatar")
    val avatar: String? = null,

    @SerializedName("phone")
    val phone: String? = null
)

/**
 * API 响应基类
 * 用于统一的 API 响应格式
 */
data class ApiResponse<T>(
    @SerializedName("Total")
    val total: Int?,

    @SerializedName("Tag")
    val tag: Int?,

    @SerializedName("Message")
    val message: String?,

    @SerializedName("Description")
    val description: Any?,

    @SerializedName("code")
    val code: Int,

    @SerializedName("Data")
    val data: T? = null
) {
    /**
     * 判断请求是否成功
     */
    fun isSuccess(): Boolean = tag == 1
}

/**
 * 分页数据
 */
data class PageData<T>(
    @SerializedName("list")
    val list: List<T>,

    @SerializedName("total")
    val total: Int,

    @SerializedName("page")
    val page: Int,

    @SerializedName("pageSize")
    val pageSize: Int
)


